//
//  PrivacyPermissionManager.h
//  Tools
//
//  Created by han on 2019/1/22.
//  Copyright © 2019 han. All rights reserved.
//

#import <Foundation/Foundation.h>
typedef NS_ENUM(NSUInteger,PrivacyPermissionType) {
    PrivacyPermissionTypePhoto = 0,
    PrivacyPermissionTypeCamera,
    PrivacyPermissionTypeLocation,
    PrivacyPermissionTypePushNotification,
    PrivacyPermissionTypeContact,
    PrivacyPermissionTypeMicrophone,
};
typedef NS_ENUM(NSUInteger,PrivacyPermissionAuthorizationStatus) {
    PrivacyPermissionAuthorizationStatusAuthorized = 0,
    PrivacyPermissionAuthorizationStatusDenied,
    PrivacyPermissionAuthorizationStatusNotDetermined,
    PrivacyPermissionAuthorizationStatusRestricted,
    PrivacyPermissionAuthorizationStatusLocationAlways,
    PrivacyPermissionAuthorizationStatusLocationWhenInUse,
    PrivacyPermissionAuthorizationStatusLocationDisable,
    PrivacyPermissionAuthorizationStatusUnkonwn,
};
NS_ASSUME_NONNULL_BEGIN

@interface PrivacyPermissionManager : NSObject

+ (instancetype)shareManager;
- (void)accessPrivacyPermissionWithType:(PrivacyPermissionType)permissionType completion:(void (^)(BOOL response, PrivacyPermissionAuthorizationStatus))completion;

// 跳转到设置页面
+ (void)jumpSetting;

//相机设备是否可用
+ (BOOL)isCameraAvaliable;

@end

NS_ASSUME_NONNULL_END

/*
 调用
 [[PrivacyPermissionManager shareManager]accessPrivacyPermissionWithType:PrivacyPermissionTypePhoto completion:^(BOOL response, PrivacyPermissionAuthorizationStatus status) {
 NSLog(@"当前线程：%@",[NSThread currentThread]);
 //当前线程不一定在MainThread
 NSLog(@"相册权限status:%lu",(unsigned long)status);
 }];
 
 */
